package service

import (
	sqlc "bgs/db/sqlc"
	"context"
)

// GetBrandSpokesmanPtr 根据用户id和品牌id获取品牌代言人
func (s *SpokesmanServiceImp) GetBrandSpokesmanPtr(ctx context.Context, q *sqlc.Queries, userID, brandID int64) (spokesmanPtr *sqlc.Spokesman, err error) {
	entity, err := q.GetNormalBrandSpokesmanByUserIDAndBrandID(ctx, sqlc.GetNormalBrandSpokesmanByUserIDAndBrandIDParams{
		UserID:  userID,
		BrandID: brandID,
	})
	if err != nil {
		return
	}
	spokesmanPtr = &entity
	return
}
